
    let btn = document.getElementById("btnSubmit");
    btn.addEventListener("click",function (e) {
        e.preventDefault();
        let arr1=[],arr2=[],arr3=[],arr4=[],arr5=[];
        let blank = document.getElementsByName("blank");
        for(let i=0;i<blank.length;i++){
            arr1.push(blank[i].value);
        }
      
        let radio = document.getElementsByName('radio');
          for(let i = 0;i<radio.length;i++){
              if(radio[i].checked){
                  arr2.push(radio[i].value);
              }
          }
        
          let checkbox1 = document.getElementsByName('checkbox1');
            for(let i=0;i<checkbox1.length;i++){
                if(checkbox1[i].checked){
                    arr3.push(checkbox1[i].value)
                }
            }
            let checkbox2 = document.getElementsByName('checkbox2');
            for(let i=0;i<checkbox2.length;i++){
                if(checkbox2[i].checked){
                    arr4.push(checkbox2[i].value)
                }
            }
            
           let judge=document.getElementsByName('judge')
              for(let i=0;i<judge.length;i++){
                  if(judge[i].checked){
                      arr5.push(judge[i].value)
                  }
              }
           
            let texts = document.getElementById("comments");
            let answer = texts.value;
            console.log(answer);

            let score = 0;
            let rule1=['统一建模语言','封装性','继承性','多态性'];
            let rule2=['B','A'];
            let rule3=['A','B','D'];
            let rule4=['A','C'];
            let rule5=['√','×'];
            let rule6=['模型是对现实世界的简化和抽象，模形式对所研究的系统、过程、事物或概念的一种表达形式。可以是物理实体；也可以是某种图形；或者是一种数学表达式。']
         
            function compareBlank(rule,arr){
                for(let i=0;i<rule.length;i++){
                    if(rule.indexOf(arr[i])!=-1){
                        score +=5;
                    }
                } 
              return score;
            }

            function compareRadio(rule,arr){
                for(let i=0;i<rule.length;i++){
                    if(rule[i]===arr[i]){
                        score +=10;
                    }
                }
                return score;
            }

            function compareCheckbox(rule,arr){
                    if(rule.toString === arr.toString){
                        score += 10 ;
                    }else{
                        for(let i=0;i<arr.length;i++){
                            if(rule.indexOf(arr[i])){
                                score += 2;
                            }
                        }
                    }
                return score;
            }
            
            function compareTest(rule,arr){
                if(arr===rule.toString()){
                    score+=20;
                }
                return score;
            }
            console.log(compareBlank(rule1,arr1));
            console.log(compareRadio(rule2,arr2));
            console.log(compareCheckbox(rule3,arr3));
            console.log(compareCheckbox(rule4,arr4));
            console.log(compareRadio(rule5,arr5));
            console.log(compareTest(rule6,answer));
          
            alert(score+'分');
            let score1 = document.getElementById('score');
            score1.innerHTML = score+'分';
    });
   